/* 
 *  @module Old IEs
 *
 *  Oh, come on, honey, just let them go
 *
 *  Author: Alex Hu
 *
 */

'use strict';

(function(){
    var $notice = $(GML.Template.tube['update-browser']())
        , dur = 1200
        , $wrap = $('#wrap')
        , nH
        ;

    $notice.insertBefore($wrap);
    nH = $notice.outerHeight(true);
    $notice.height(0);
    var control = function(s){
        if(s === '+'){
            $notice.show();
        }
        $notice.animate({
            'height': s + '=' + nH
        }, dur, function(){
            if(s === '-'){
                $notice.hide();
            }
        });
        $('#header, #container > .extra').animate({
            'top': s + '=' + nH
        }, dur);
        $wrap.animate({
            'paddingTop': s + '=' + nH
        }, dur);
    }
    control('+');

    $(document).on('click', '[role~=close-top-notice]', function(e){
        control('-');
        e.preventDefault();
    });

})();

